﻿using System;
using System.Collections.Generic;
using System.Data.Objects.DataClasses;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace RouteTiming.Data
{
    public partial class RoutePoint
    {
        [DataMember()]
        public TimeSpan PassTimeSpan
        {
            get
            {
                if (string.IsNullOrEmpty(this.PassInterval))
                    return TimeSpan.Zero;

                return TimeSpan.Parse(this.PassInterval);
            }

            set 
            {
                this.PassInterval = value == TimeSpan.Zero ? null : value.ToString();
            }
        }
    }
}
